<!DOCTYPE html>
<html>

<head>
    <meta name="layout" content="main2"/>
    <g:set var="entityName" value="${message(code: 'menuItem.label', default: 'MenuItem')}"/>

    <title>编辑menuItem</title>
</head>

<body>

<div class="main-body">
    <div class="page-wrapper">
        <!-- Page-header start -->
        <div class="page-header">
            <div class="page-header-title">
                <h4>编辑menuItem</h4>
            </div>

            <div class="page-header-breadcrumb">
                <ul class="breadcrumb-title">
                    <li class="breadcrumb-item">
                        <a href="/salesDashboard/index">
                            <i class="icofont icofont-home"></i>
                        </a>
                    </li>
                    <li class="breadcrumb-item">
                        <g:link controller="menu" action="show" id="${this.menuItem?.menu?.id}">菜单详情</g:link>
                    </li>
                    <li class="breadcrumb-item"><a href="#!">编辑menuItem</a>
                    </li>
                </ul>
            </div>
        </div>
        <!-- Page-header end -->
        <!-- Page-body start -->
        <div class="page-body">
            <g:if test="${flash.message}">
                <div class="message" menu="status">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${this.menuItem}">
                <ul class="errors" menu="alert">
                    <g:eachError bean="${this.menuItem}" var="error">
                        <li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>>
                            <g:message error="${error}"/>
                        </li>
                    </g:eachError>
                </ul>
            </g:hasErrors>
        <!-- Hover table card start -->
            <div class="card">
                <div class="card-header">
                    <h5>编辑menuItem</h5>

                    <div class="card-header-right">

                        <i class="icofont icofont-rounded-down"></i>
                    </div>
                </div>

                <div class="card-block">
                    <g:form resource="${this.menuItem}" method="PUT">
                        <div class="form-group row">
                            <input type="hidden" name="menu.id" value="${this.menuItem?.menu?.id}">

                            <label class="col-md-3 control-label is-required">名称</label>
                            <div class="col-md-4">
                                <g:textField name="name" class="form-control" value="${this.menuItem?.name}"/>
                            </div>
                        </div>
                        
                        <div class="form-group row">
                            <label class="col-md-3 control-label">链接</label>
                            <div class="col-md-4">
                                <g:textField name="linkUrl" class="form-control" value="${this.menuItem?.linkUrl}"/>
                            </div>
                        </div>

                        
                        <div class="form-group row">
                            <label class="col-md-3 control-label">顺序</label>
                            <div class="col-md-4">
                                <g:textField name="displayOrder" class="form-control" value="${this.menuItem?.displayOrder}"/>
                            </div>
                        </div>
                        
                        <div class="form-group row">
                            <label class="col-md-3 control-label">类型</label>
                            <div class="col-md-4">
                                <g:select class="form-control" name="type"
                                          value="${this.menuItem?.type}" from="${this.menuItem.constrainedProperties.type.inList}"></g:select>

                            </div>
                        </div>
                        
                        <div class="form-group row">
                            <label class="col-md-3 control-label">父级</label>
                            <div class="col-md-4">
                                <g:select class="form-control" name="parent.id" optionKey="id" optionValue="name"
                                          value="${this.menuItem?.parent}"  from="${com.next.MenuItem.list()}"></g:select>

                            </div>
                        </div>
                        
                        <div class="form-group row">
                            <label class="col-md-3 control-label">图标</label>
                            <div class="col-md-4">
                                <g:textField name="icon" class="form-control" value="${this.menuItem?.icon}"/>
                            </div>
                        </div>
                        
                        <div class="form-group row">
                            <div class="col-md-7">
                                <button class="btn btn-info">保存</button>
                            </div>
                        </div>
                    </g:form>

                </div>
                <!-- Hover table card end -->
            </div>

            <!-- Page-body end -->
        </div>
    </div>
</div>
<script>
    $(function () {
        $("input[name='displayOrder']").TouchSpin({
            verticalbuttons: true,
            min: 0,
            max: 10000
        });
    })
</script>

</body>

</html>


